#ifndef MENU_H_
#define MENU_H_

#include <iostream>
#include <string>
#include <stdexcept>
#include <vector>
//other types
#include "Category.h"
#include "Menu_Item.h"
#include "Recipe.h"
#include "Ingredient.h"
#include "Order.h"
#include "Order_Item.h"
#include "Description.h"
#include <fstream>

using namespace std;

class Menu {
public:
   struct InvalidData : std::runtime_error {
      InvalidData(): runtime_error("Invalid input data format") {}
   };

   struct InvalidFile : std::runtime_error {
      InvalidFile(): runtime_error("Invalid input file name") {}
   };

   enum Main_menu_options{ Info=1, Read, Show, Find, Update, Exit }; 
		
	Menu();
   
   void display_main_menu() const;
   void display_info() const;//display assignment info & your name plus "Project Part I"
   void read();		 
   void update();
   void show();
   void find() const;
      
   int getOption() ;//Andre B1
   void query_item() ;//Andre B1
   void	query_chef() ;//Andre B1
   void query_category() ;//Andre B1
   void exit_query() ;//Andre B1
   Menu_Item get_menu_item(Recipe r) ;//Andre B1
   string get_ingredients(Recipe rec);//Andre B1
   string toString(float);//Andre B1
   vector<string> get_chefs();//Andre B1
   vector<Recipe> get_recipes_chef(string);//Andre B1
   bool contains(vector<string>,string);//Andre B1
   vector<Menu_Item>get_items_category(Category);//Andre B1
   vector<Menu_Item> sort_items_by_price(vector<Menu_Item> items);//Andre B1

	


			
   
private:
   //private data
	vector<Category> categories;
	vector<Menu_Item> menu_items;
	vector<Recipe> recipes;
	vector<Ingredient> ingredients;
	vector<Order> orders;
	vector<Order_Item> order_items;
	//Private functions
	void loadCategoryAndMenu(string filename);
	
     /**
      * Print commands that are available in Update menu
      */
     void showUpdateCommands();
      /**
      * Get category in categories array that have the given id.
      * return NULL if not found
      */
     Category* getCategoryById(int id);
      /**
      * Get Menu_Item in menu_items based on id
      * return NULL if not found
      */
     Menu_Item* getMenuItemById(int id);
      /**
      * Get Recipe in recipes based on id
      * return NULL if not found
      */
     Recipe* getRecipeById(int id);
      /**
      * Get Order in orders based on id
      * return NULL if not found
      */
      Order* getOrderById(int id);
};
	
#endif //MENU_H_
